package dice.sinanya.windows;

import javax.swing.*;
import java.awt.*;

public class SplashWindow extends JWindow {
    public SplashWindow(String filename, Frame f) {
        super(f);
        JLabel l = new JLabel(new ImageIcon(filename));
        getContentPane().add(l, BorderLayout.CENTER);
        pack();
        Dimension screenSize =
                Toolkit.getDefaultToolkit().getScreenSize();
        Dimension labelSize = l.getPreferredSize();
        setLocation(screenSize.width / 2 - (labelSize.width / 2),
                screenSize.height / 2 - (labelSize.height / 2));
        setVisible(true);
        screenSize = null;
        labelSize = null;
    }
}
